home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / shell / MJPipe09.lha / Pipe.doc < prev   
Text File  |  1994-12-12  |  3KB  |  97 lines

  1.  
  2.                           PIPE Command for Amiga Shell
  3.  
  4.                  (c) 1994 Martin Mares, MJSoft System Software
  5.  
  6. ================================================================================
  7.  
  8.  
  9. Preface
  10. =======
  11.  
  12.    Pipe  0.9 and its documentation are Copyright (c) Martin Mares, MJSoft System
  13. Software, Prague, Czech Republic.
  14.  
  15.    This  archive  can  be  freely redistributed, as long as all of its files are
  16. included   in   their   original   form  without  any  additions,  deletions  or
  17. modifications,  and  no more than a nominal fee is charged for its distribution.
  18. All  copyright notices in the programs and accompanying documentation files must
  19. remain  on  their  places.  Also '.displayme' and other similar files may not be
  20. added.  This is generally known as FREEWARE.
  21.  
  22.    This  software  is  provided  "AS  IS"  without  warranty of any kind, either
  23. expressed  or  implied.   The author is not responsible for any damage caused by
  24. it.
  25.  
  26.  
  27. Introduction
  28. ============
  29.  
  30.    Standard  AmigaDos  Shell  doesn't  directly support any kind of piping.  The
  31. Queue-Handler  supplied  by  CBM  allows to create only named pipes.  No kind of
  32. usual UNIX-like pipes is here!
  33.  
  34.    But... The Shell allows to specify two local environment variables called
  35. _pchar and _mchar. Each of these variables can contain one or two characters (if
  36. more than two chars are specified, the rest of the string is silently ignored).
  37. If any of these characters is found in the command line, surrounded by
  38. whitespaces, the command line is pre-parsed (all $xxx and `xxx' constructs are
  39. substituted etc.) and the result is passed as an argument to a command called
  40. 'PIPE', which would do everything needed to create the pipe if it were here...
  41. And it's here now!
  42.  
  43.    PIPE is pure and can be made resident.
  44.  
  45.  
  46. Requirements
  47. ============
  48.  
  49.    - Kickstart 2.04 or higher (well, it would be simple to write it compatible
  50. with 1.3, but the 1.3 Shell doesn't support those piping features).
  51.  
  52.    - 68000 or higher
  53.  
  54.  
  55. Usage
  56. =====
  57.  
  58.    Add the following two lines to your S:Shell-startup:
  59.  
  60. set _pchar "|"
  61. set _mchar "||"
  62.  
  63.    and copy the Pipe command to any directory which is in your path.
  64.  
  65.    After these steps, your Shell will be able to process standard UNIX-like pipe
  66. commands. For example:
  67.  
  68. gzip -d <test.tar.gz | tar tvf -
  69.  
  70.    lists a tar archive compressed with gzip. Or:
  71.  
  72. list nohead | fsort | tee ram:x
  73.  
  74.    prints out a sorted listing of current directory, copying it also to ram:x.
  75. (The fsort and tee commands were also written by me and can be found on the
  76. AmiNet in archives: SSLExamples2.lha and MJUtils.lha.)
  77.  
  78.    The standard pipe has a 4K buffer. In some cases (for example if
  79. decompressing a large tar archive with gzip unpacking), larger size would be
  80. better. This can be accomplished by specifying '||' instead of '|', which asks
  81. Pipe to use a 'thick pipe' with 64K buffer.
  82.  
  83.  
  84. Known bugs
  85. ==========
  86.  
  87.    I'm very sorry, but this version of Pipe doesn't support scripts yet, because
  88. I don't know any way of asynchronous execution of scripts which would accept
  89. different stdin and stderr and which would return proper return codes to the
  90. caller. If you know how to do it, send me a mail.
  91.  
  92.  
  93. Notes
  94. =====
  95.  
  96.    Send comments, suggestions and bug reports to mjsoft@k332.feld.cvut.cz
  97.